<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery.min.js"></script>
    <style>
        table {
            text-align: center;
            height: 45px;
        }

        a {
            text-decoration: none;
        }

        thead tr {
            background-color: #0099cc;
        }
    </style>
</head>

<body>
    <button>添加数据</button>
    <table width="700" cellspacing="0" border="">
        <thead>
            <tr>
                <th>课程名称</th>
                <th>所属学院</th>
                <th>已学会</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>JavaScript</td>
                <td>传智播客</td>
                <td><a href="javaScript:;">GET</a></td>
            </tr>
            <tr>
                <td>JavaScript</td>
                <td>传智播客</td>
                <td><a href="javaScript:;">GET</a></td>
            </tr>
            <tr>
                <td>JavaScript</td>
                <td>传智播客</td>
                <td><a href="javaScript:;">GET</a></td>
            </tr>
            <tr>
                <td>JavaScript</td>
                <td>传智播客</td>
                <td><a href="javaScript:;">GET</a></td>
            </tr>
        </tbody>
    </table>
    <script>
        //点击创建元素，并追加进tbody内容的后面
        $('button').click(function () {
            var node = '<tr><td>Html</td><td>传智播客</td><td><a href="javaScript:;">GET</a></td></tr>'
            $('tbody').append(node)
            //给添加的a标签绑定点击事件，删除本行
            $('a').click(function () {
                $(this).parents('tr').remove()
            })
        })

        //给原先就有的a标签绑定点击事件，删除本行
        $('a').click(function () {
            $(this).parents('tr').remove()
        })

    </script>
</body>

</html>